package com.ghost.view.pop
{
	import com.ghost.UI.Ghost_txt;
	import com.ghost.event.Pop_win_event;
	import com.ghost.manager.Effect_manager;
	import com.ghost.model.Effect_data;
	import com.ghost.model.Global_data;
	
	import fl.transitions.Fade;
	import fl.transitions.Transition;
	import fl.transitions.Zoom;
	import fl.transitions.easing.Bounce;
	import fl.transitions.easing.Strong;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.utils.clearTimeout;
	import flash.utils.setTimeout;
	
	import flashx.textLayout.formats.TextAlign;

	/**
	 * @author ghost
	 * 显示一些游戏提示描述数据
	 */	
	public class Show_game_des extends Sprite
	{
		private var txt:Show_game_des_cell;
		private var textformate_v:Vector.<TextFormat>;
		private var content_arr:Array=[];
		public function Show_game_des()
		{
			super();
			textformate_v = new Vector.<TextFormat>();
			textformate_v.push(new TextFormat(null,16,0xff0000))
		}
		/**
		 * @param str 显示的文本
		 * @param type 文本格式类型 (自定义)
		 */		
		public function show(str:String,type:int=0):void
		{
			var i:int = 0;
			for(;i<content_arr.length;i++)
			{
				content_arr[i].y -= content_arr[i].height;
			}
			txt = new Show_game_des_cell();
			txt.show_str(str,textformate_v[type]);
			this.addChild(txt);
			content_arr.push(txt);
			txt.addEventListener(Pop_win_event.removed_effect_event,out);
			Effect_manager.getInstance().set_effect(txt,Effect_data.fade_out_obj1);
		}
		public function out(e:Pop_win_event):void
		{
			Show_game_des_cell(e.target).removeEventListener(Pop_win_event.removed_effect_event,out);
			content_arr[0] = null;
			content_arr.shift();
			this.removeChild(Show_game_des_cell(e.target));
		}
		public function reflash():void
		{
			this.x = Global_data.stage_s_width/2-this.width/2;
			this.y = Global_data.stage_s_height/2-this.height/2;
		}
	}
	
}